package com.letoken.platform.app.controller;

import com.letoken.platform.app.service.QRCodeService;
import com.letoken.platform.pub.annotation.pub.Trim;
import com.letoken.platform.pub.res.ApiResponse;
import com.letoken.platform.repo.app.req.QRCode.QRCodeReq;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * @author wyl
 * @date 2023/5/2 14:16
 * @Version 1.0
 */
@RestController
@RequestMapping("/qrcode")
public class QRCodeController {

    @Autowired
    private QRCodeService qrCodeService;

    /**
     * 根据 content 生成二维码
     */
    @Trim
    @PostMapping("/getQRCodeBase64")
    @ApiOperation(value = "生成二维码", notes = "生成二维码")
    public ApiResponse<?> getQRCode(@RequestBody @Validated QRCodeReq req) {
        return ApiResponse.create(qrCodeService.getQRCode(req));
    }

}
